package io.renren.controller;

import io.renren.common.utils.R;
import io.renren.common.utils.RedisUtils;
import io.renren.service.impl.SysDictServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/dic")
@Api(tags = "查询内容接口")
public class DictController {

    @Autowired
    private SysDictServiceImpl sysDictService;

    @RequestMapping("list")
    @ApiOperation("获取内容列表")
    public R list(String type) {
        try {
            Map<String, Object> params = new HashMap<>();
            params.put("type", type);
            return R.ok().put("data", sysDictService.list(params));
        } catch (Exception e) {
            return R.error(9999, "查询菜单失败");
        }
    }

}
